package com.yanqu.road.server.cmd.activity.tonbing;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.TonBingProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.manager.activity.tonbing.CrossTonBingMgr;
import com.yanqu.road.server.manager.activity.tonbing.activity.CrossTonBingActivity;
import com.yanqu.road.server.protocol.CrossProtocol;
import io.netty.channel.ChannelHandlerContext;

@Cmd(code = CrossProtocol.C2_CROSS_TON_BING_NOTIFY_UNION_MEMBER_CHANGE_REQ, desc = "")
public class CrossTonBingNotifyUnionMemberChangeReqCmd implements Command {

    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {
        TonBingProto.CrossTonBingNotifyUnionMemberChangeReqMsg reqMsg = TonBingProto.CrossTonBingNotifyUnionMemberChangeReqMsg.parseFrom(packet.getBytes());
        CrossTonBingActivity activity = CrossTonBingMgr.getActivity(reqMsg.getActivityId());
        activity.notifyUnionMemberChangeByCmd(reqMsg.getUnionUid());
    }
}
